<?php
/**
 * Created by PhpStorm.
 * User: edmmss
 * Date: 2018/12/5
 * Time: 11:02
 */

namespace app\modules\fluentInterface\controller;


use app\modules\fluentInterface\Sql;
use yii\web\Controller;

class DefaultController extends Controller
{
    /**
     * 流接口模式示例
     * 用来编写易于阅读的代码，就像自然语言一样（如英语）
     *
     * @date   2018/12/5
     * @author edmmss
     * @return bool
     */
    public function actionIndex()
    {
        $sqlString = (new Sql())
            ->select(['id', 'name'])
            ->from('test')
            ->where('id=10');

        echo $sqlString;
        echo '<hr>';

        return true;
    }
}